import Vue from 'vue'
import Router from 'vue-router'
import error404 from '@/components/404'
import home from '@/components/home'
import food from '@/components/food'
import seller from '@/components/seller'
import rating from '@/components/rating'
import subfood from '@/components/subfood'
import subextend from '@/components/subextend'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [ 
    {
      path: '*',
      name: 'error404',
      component: error404
    },
    {
      path: '/',
      name: 'home',
      component: home,
      children:[
        {
          path: '/food',
          name: 'food',
          component: food,
          alias: '/',
          children:[
            {
              path: '/food/:id',
              name: 'subfood',
              components: {
                default: subfood,
                ex: subextend
              }
            }
          ]
        },
        {
          path: '/seller',
          name: 'seller',
          component: seller
        },
        {
          path: '/rating',
          name: 'rating',
          component: rating
        }
      ]
    }
  ]
})


